package com.jhc.drone.communication.web;


import com.jhc.drone.communication.service.MissionService;
import com.jhc.drone.communication.vo.MissionVo;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author lcp
 * @date 2025年02月2025/2/20 10:46
 * @describe
 */
@RequestMapping("mission")
@RestController
@RequiredArgsConstructor
public class MissionController {

    private final MissionService missionService;

    @PostMapping("upload")
    public void uploadMission(@RequestBody MissionVo mission) throws Exception {
        missionService.uploadMission(mission);
    }

    @DeleteMapping("delete")
    public void deleteMission(@RequestParam("sn") String sn) throws Exception {
        missionService.deleteMission(sn);
    }

    @GetMapping("start")
    public void startMission(@RequestParam("sn") String sn) throws Exception {
        missionService.startMission(sn);
    }



}
